package net.betou.trade.main.dao;

import java.util.List;

import net.betou.common.hibernate3.Updater;
import net.betou.common.page.Pagination;
import net.betou.trade.entity.main.Role;
/**
 * @deprecated
 * @author 叶装装
 *
 */
public interface RoleDao{
	
	public Role findById( Integer id );
	
	/**
	 * 查找居间或者管理员角色
	 * @param id
	 * @return
	 */
	public Role findByAgentOrAdminRole( Boolean manager,  Integer id );

	/**
	 * 	根据ID删除
	 * @param id
	 * 					传入的ID
	 * @return
	 */
	public Role deleteById( Integer id );

	/**
	 * 保存
	 * @param bean
	 * @return
	 */
	public Role save( Role bean );

	/**
	 * 更新
	 * @param updater
	 * @return
	 */
	public Role updateByUpdater( Updater< Role > updater );
	
	/**
	 * 根据等级查找
	 * @param level
	 * @return
	 */
	public Role findByLevel( Integer level );
	
	/**
	 * 根据标识符查找
	 * @param identity
	 * @return
	 */
	public Role findByIdentity( String identity );
	
	/**
	 * 查找List
	 * @param isManager
	 * @param level
	 * @param searchProperty
	 * @param searchValue
	 * @param orderProperty
	 * @param orderDirection
	 * @return
	 */
	public List< Role > getRoleList( Boolean allowRead, Boolean isManager, Integer level, String searchProperty, String searchValue, String orderProperty, String orderDirection );
	
	public Pagination getAgentPage( Integer level,  Integer selfId,  String searchProperty, String searchValue, String orderProperty, String orderDirection, int pageSize, int pageNo );
	
	
	public List< Role > getAgentRoleList(  Integer level, Integer selfId );
	
	public Integer findMaxLevel( Integer selfId );
	
	public Role findMyData( Integer selfId, Integer id );
	
	public Role findMyDefaultRole( Integer selfId, String identity );
	
	public List< Role > getAgentRoleListByIdentity( String identity );
	
}
